#include<stdio.h>
#include<stdbool.h>

bool isPrime(int num) {
    if (num <= 1)
        return false;
    for (int i = 2;i * i <= num;i++)
        if (num % i == 0)
            return false;
    return true;
}

int main() {
    int M, N;
    int count = 0;
    int sum = 0;

    scanf("%d %d", &M, &N);
    for (int i = M;i <= N;i++)
        if (isPrime(i)) {
            count++;
            sum += i;
        }
    printf("%d %d\n", count, sum);
    return 0;
}